This disclosure relates generally to the field of graphics processing. More particularly, but not by way of limitation, this disclosure relates to encoding and executing indirect command buffers on a graphics processor, such as a graphics processing unit (GPU).
Computers, mobile devices, and other computing systems typically have at least one programmable processor, such as a central processing unit (CPU) and other programmable processors specialized for performing certain processes or functions (e.g., graphics processing). Examples of a programmable processor specialized to perform graphics processing operations include, but are not limited to, a GPU, a digital signal processor (DSP), a field programmable gate array (FPGA), and/or a CPU emulating a GPU. GPUs, in particular, comprise multiple execution cores (also referred to as shader cores) designed to execute commands on parallel data streams, making them more effective than general-purpose processors for operations that process large blocks of data in parallel. For instance, a CPU functions as a host and hands-off specialized parallel tasks to the GPUs. Specifically, a CPU can execute an application stored in system memory that includes graphics data associated with a video frame. Rather than processing the graphics data, the CPU forwards the graphics data to the GPU for processing; thereby, freeing the CPU to perform other tasks concurrently with the GPU's processing of the graphics data.
To perform graphics processing, applications utilize graphics application program interfaces (APIs), such as OpenGL®, Direct3D®, or Metal®, to interface with a graphics processor, such as a GPU (OPENGL is a registered trademark of Silicon Graphics, Inc.; DIRECT3D is a registered trademark of Microsoft Corporation; and METAL is a registered trademark of Apple Inc.). To utilize certain GPU capabilities, applications and/or developers may allocate and pass a set of graphics API resources via one or more API calls to the GPU. Each API call could have sizeable overhead cost and/or latency associated with generating the API call. Additionally, where a particular set of API calls are used from frame to frame, passing the set of API calls repeatedly over multiple frames often is a relatively inefficient use of system resources and is time consuming. As such, having a graphics API that allows applications and/or designers to efficiently managing API calls may be beneficial in improving application performance.